package cn.getech.data.development.constant;

import lombok.Getter;

@Getter
public enum RangerPolicyType {

    ACCESS(0 , "库表字段权限策略类型" ),
    MASKING(1 , "字段加密权限策略类型" ),
    ROW_LEVEL_FILTER(2 , "行过滤策略类型" ),
    EXPLORE_TABLE(3 , "explore库下的表" );
    private  int id;
    private  String  name;
    RangerPolicyType(int id , String  name){
        this.id = id;
        this.name = name;
    }

    public static RangerPolicyType ObjOf(Integer status) {
        if (status == null) {
            return null;
        } else {
            for (RangerPolicyType s : RangerPolicyType.values()) {
                if (s.getId() == status) {
                    return s;
                }
            }
            return null;
        }
    }
}
